Characterization of Program Loops in Code Optimization
نویسندگان
چکیده
-Recent work in code optimization has led to development of new unified optimizing transformations[6,7]. Application of these transformations requires solution of bi-directional data flow problems over program flow graphs using iterative solution techniques. Appropriate characterization of program loops in the flow graph is necessary so as (i) not to hinder code movement, etc., and (ii) restrict optimization overheads to low levels. This paper reviews alternate loop characterizations and proposes a characterization which leads to minimum overheads and has certain nice properties from a practical viewpoint. I . I N T R O D U C T I O N Program loops are a fertile source of optimization possibilities. Program optimizers therefore spend a considerable amount of time and effort on the optimization of program loops. Common program transformations applied for loop optimization are: (i) movement of loop invariant computations to places outside the loops; (ii) strength reduction, i.e. replacement of operations consuming large amounts of processor time by operations which are performed faster; (iii) assignment of registers to hold values frequently accessed within a loop. Conventional approach to loop optimization entails applying individual optimizing transf6rmations to program loops one after another. Thus, after identifying a program loop, the transformation of moving loop invariant computations out of a loop could be applied followed by the strength reduction optimization for computations remaining within the 1oop[1,2,3]. This approach requires identification of program loops through analysis of the control flow within the program (the so called proper loops [4]). Since this involves considerable effort on the part of the optimizer, it results in high optimization costs. Certain optimizers like the BLISS optimizing compiler[5] attempted to reduce optimization cost by restricting optimization to program loops implemented through iteration control constructs like while.. , do, repeat.. , until, etc. of the source language. This eliminates the need to identify program loops though at the cost of failure to optimize loops implemented through i f . . . then goto . . , constructs. Recent research in code optimization has attempted to reduce optimization costs through unification of certain conventional transformations. One such unification which might be termed generali:ed code movement unifies common subexpression elimination, code hoisting and loop invariant movement within one framework[6,7]. This unified framework can apply code movement to arbitrary program topologies without the need to identify program regions or program loops, thus bringing about a significant reduction in the optimization costs. Another important unification is achieved by integrating the optimization of strength reduction with generalized code movement[8,9], which on one hand enhances profitability of program optimization and on the other hand leads to significant savings in the optimization effort. Both the Morel-Renvoise[7] and Joshi-Dhamdhere[9] algorithms use program data flow analysis techniques to collect information regarding the definition and use of program variables preparatory to the optimization. A program is represented in the form ofa program flow graph in order to apply the data flow analysis equations. Program loops implemented through repeat.. , until . . , or similar HLL constructs are easily represented in the flow graph, however representation of while.. , do loops in the program flow graph poses certain interesting problems. Variant loop characterizations are possible, each with different attendant optimization costs. This paper presents a characterization for while.. , do loops
منابع مشابه
An Unfolding-Based Loop Optimization Technique
Loops in programs are the source of many optimizations for improving program performance, particularly on modern high-performance architectures as well as vector and multithreaded systems. Techniques such as loop invariant code motion, loop unrolling and loop peeling have demonstrated their utility in compiler optimizations. However, many of these techniques can only be used in very limited cas...
متن کاملLecture Notes on Cache Iteration & Data Dependencies 15 - 411 : Compiler Design
Cache optimization can have a huge impact on program execution speed. It can accelerate by a factor 2 to 5 for numerical programs. Loops are the parts of the program that are generally executed most often. That is why cache optimization usually focuses exclusively on handling loops. Especially for loops that execute very often, optimizing small chunks of source code can have a fairly significan...
متن کاملContext Optimization for SIMD Execution yKen
One issue that SIMD compilers must address is generating code to change the machine context; i.e., disabling processors not involved in the current computation. We present two compiler optimizations that reduce the cost of context changes. The rst optimization , context partitioning, reorders the Fortran 90 code so that as subgrid loops are generated, as many statements as possible that require...
متن کاملTyped Fusion with Applications to Parallel and Sequential Code Generation
Loop fusion is a program transformation that merges multiple loops into one and is an effective optimization both for increasing the granularity of parallel loops and for improving data locality. This paper introduces typed fusion, a formulation of loop fusion which captures the fusion and distribution problems encountered in sequential and parallel program optimization. Typed fusion is more ge...
متن کاملTiming and Code Size Optimization on Achieving Full Parallelism in Uniform Nested Loops
Multidimensional Retiming is one of the most important optimization techniques to improve timing parameters of nested loops. It consists in exploring the iterative and recursive structures of loops to redistribute computation nodes on cycle periods, and thus to achieve full parallelism. However, this technique introduces a large overhead in a loop generation due to the loop transformation. The ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Comput. Lang.
دوره 8 شماره
صفحات -
تاریخ انتشار 1983